package cn.edu.scau.cmi.chenzehan.multipPattern;

import java.util.HashSet;
import java.util.Set;

public class OutstandingYouth {

	private String name;
	private static int maxNumber =10;
	private static Set<OutstandingYouth> team = new HashSet<OutstandingYouth>();
	
	private OutstandingYouth() {	
	}
	private OutstandingYouth(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	public static Set<OutstandingYouth> addYouths(String name){
		if(team.size()<maxNumber) {
			 OutstandingYouth youth = new OutstandingYouth(name);
			team.add(youth);
			System.out.println(name + "成为十大杰出青年之一！");
		}
		else System.out.println("添加失败，人数已满");
		return team;

	}
}
